package com.example.demo.Service;


import com.example.demo.model.ArticleInfo;
import com.example.demo.model.User;
import com.example.demo.mapper.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.net.Inet4Address;
import java.util.List;

@Service
public class UserService {

    @Resource
    private UserMapper userMapper;

    public List<User> getAll(){
        return userMapper.getAll();
    }

    public Integer getAdd(User user){return userMapper.getAdd(user);}

    public void getAdd2(User user) {
        userMapper.getAdd2(user);
        return;
    }

    public Integer update(Integer id, String name) {
        return userMapper.update(id, name);
    }

    public Integer delById(Integer id){
        return userMapper.delById(id);
    }

    public User getUserById(Integer id) {
        return userMapper.getUserById(id);
    }

    public User isLogin(String name, String pwd){
        return userMapper.isLogin(name,pwd);
    }

    public ArticleInfo getArtById(Integer id){
        System.out.println("查询对象的id是:"+id);
        return userMapper.getArtById(id);
    }

}
